﻿#define ALLOW_TWO_MODE

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace Graph
{
    static class Program
    {
        public static bool ConsoleMode = false;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
#if (ALLOW_TWO_MODE)
            string[] args = Environment.GetCommandLineArgs();
            if (args.Contains("-c"))
            {
#endif
                ConsoleMode = true;
                RunAsConsole();
#if (ALLOW_TWO_MODE)
            }
            else
            {
                RunAsWinForms();
            }
#endif
        }

        private static void RunAsConsole()
        {
            BaseGraph graph = new DirectedGraph("GRAPH.INP");
            graph.findAllCycles();
            graph.printAllCyclesToFile("GRAPH.OUT");
        }

#if (ALLOW_TWO_MODE)
        private static void RunAsWinForms()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmMain());
        }
#endif
    }
}
